package mushystuff.dtb.web.controller;

import javax.servlet.http.HttpSession;

import mushystuff.dtb.core.model.Product;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping(value="/productDashboard.do")
public class ProductDashboard extends BaseController{
    
    @RequestMapping(method = RequestMethod.GET)
    public String viewProducts(HttpSession session, ModelMap model) {
        Product product = productService.getProduct((Long)session.getAttribute("productId"));
        model.addAttribute("product", product);
        return "dtb.productDashboard";  
    }

}
